package com.ideaaedi.springcloud.jd.commonspring.annotation;

import com.ideaaedi.springcloud.jd.commonspring.config.XxlJobConfig;
import com.ideaaedi.springcloud.jd.commonspring.enhancer.FillReturnAdvice;
import com.ideaaedi.springcloud.jd.commonspring.refresher.ApiResourceRefresher;
import com.ideaaedi.springcloud.jd.commonspring.registrar.FeatureJdRegistrar;
import com.ideaaedi.springcloud.jd.commonspring.support.CommonService;
import org.springframework.context.annotation.Import;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 启用common-spring feature
 *
 * @see FeatureJdRegistrar
 *
 * @author <font size = "20" color = "#3CAA3C"><a href="https://gitee.com/JustryDeng">JustryDeng</a></font> <img
 * src="https://gitee.com/JustryDeng/shared-files/raw/master/JustryDeng/avatar.jpg" />
 * @since 1.0.0
 */
@Inherited
@Documented
@Import(FeatureJdRegistrar.class)
@Target(value = ElementType.TYPE)
@Retention(value = RetentionPolicy.RUNTIME)
public @interface EnableJdFeature {
    
    /**
     * 是否启用基础服务支持
     *
     * @see CommonService
     */
    boolean enableCommonService() default false;
    
    /**
     * 是否启用api资源刷新器
     *
     * @see ApiResourceRefresher
     */
    boolean enableApiRefresher() default false;
    
    /**
     * 是否启用xxl-job配置
     *
     * @see XxlJobConfig
     */
    boolean enableXxlJobConfig() default false;
    
    /**
     * 是否启用service返回值填充增强器
     *
     * @see FillReturnAdvice
     */
    boolean enableFillReturnAdvice() default false;
}
